$(function () {
    /**
     * 提交学生报名信息
     */
    $("#Submit").click(function () {
        $.ajax({
            url: 'admin/Student/insert',
            data: $("#studentForm").serialize(),
            type: 'POST',
            dataType: 'JSON',
            success: function (returnData) {
                console.info("success");
                if (returnData.status == 0) {
                    $.TeachDialog({
                        content: returnData.msg,
                    });
                } else {
                    $.TeachDialog({
                        title:"<h3>系统信息<h3>",
                        content: returnData.msg,
                        showCloseButton: true,
                        showCloseButtonName: '关闭',
                        CloseButtonAddFunc: function () {
                            document.getElementById('studentForm').reset();
                        },
                        // otherButtons: ['去往管理页'],
                        // otherButtonStyles: ['btn-primary'],
                        // clickButton: function (sender, modal, index) {
                        //     $.ajax({
                        //         url:'admin/Ajax/student_manage',
                        //         dataType:'HTML',
                        //         success:function(data){
                        //             modal.modal('hide');
                        //             $('#studentGoManage').html(data);
                        //         }
                        //
                        //     });
                        // }
                    });
                }
            },
            error: function () {
                $.TeachDialog({
                    content: '添加失败',
                });
            }
        });
    });
});